import Vue from 'vue'
import VueRouter from 'vue-router'
import login from '../views/login.vue'
import choseObjectSpecial from '../views/choseObjectSpecial.vue'
import pay from '../views/pay.vue'
import choseObject from '../views/choseObject.vue'
import payResult from '../views/payResult.vue'
import writeForm from '../views/writeForm.vue'
import ajDetail from '../views/ajDetail.vue'
import writeFormSpecial from '../views/writeFormSpecial.vue'
import { getIsSpecial } from '@/utils/utils'
import phoneSearchOrder from '../views/search/phoneSearchOrder.vue'
import shSeasrchOrder from '../views/search/shSeasrchOrder.vue'
Vue.use(VueRouter)
var special = getIsSpecial();
var routes = []
if (special) {
  routes = [
    {
      path: '/',
      name: 'choseObject',
      component: choseObjectSpecial
    }
  ]
} else {
  routes = [
    {
      path: '/',
      name: 'choseObject',
      component: choseObject
    }
  ]
}
routes = routes.concat([
  {
    path: '/login',
    name: 'login',
    component: login
  },
  {
    path: '/pay',
    name: 'pay',
    component: pay
  },
  {
    path: '/payResult',
    name: 'payResult',
    component: payResult
  },
  {
    path: '/writeForm',
    name: 'writeForm',
    component: writeForm
  },
  {
    path: '/writeFormSpecial',
    name: 'writeFormSpecial',
    component: writeFormSpecial
  },
  {
    path: '/ajDetail',
    name: 'ajDetail',
    component: ajDetail
  },
  {
    path: '/phoneSearchOrder',
    name: 'phoneSearchOrder',
    component: phoneSearchOrder
  },
  {
    path: '/shSeasrchOrder',
    name: 'shSeasrchOrder',
    component: shSeasrchOrder
  }
])

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})




export default router
